import os
import Customer, Story, Accomplishment, Time

def Asset (money, warehouse_level, player_level, customer_name, 
           level_up_need_xp, player_xp, all_sold_count, all_day_count, 
           time_hour, time_minute, acc_num, time_second, player_name,
           times_serve, times_orders, sold_time, story_num):
    os.system ('cls')
    while (True):
        try:
            time_hour, time_minute, time_second = Time.ComputeTime (time_hour, time_minute, time_second)
            print ("|---------------------------------------")
            print (f"|店名{player_name}")
            print (f"|持有{money}₿")
            print (f"|仓库{warehouse_level}级")
            print (f"|玩家{player_level}级")
            i = float (level_up_need_xp[player_level - 1]) / 40.0
            if (player_level == 20):
                print ("|已经满级了！")
            else :
                x = int (player_xp / i)
                print ("|", end = '')
                for i in range (x):
                    print ("\033[1;32m━", end = "")
                for i in range (40 - x):
                    print ("\033[1;37m━", end = "")
                print ("\033[0m")
                print (f"|距离下一级还需{level_up_need_xp[player_level - 1] - player_xp}点经验")
            print ("|---------------------------------------")
            print (f"|当前有{len (customer_name)}名长期顾客")
            print (f"|共计招待{times_serve}次顾客")
            print (f"|完成订单{times_orders}次") 
            print (f"|已累计销售{all_sold_count}单位商品")
            print (f"|已营业{all_day_count}天")
            print (f"|已累计开店营业{sold_time}小时(游戏)")
            print ("|---------------------------------------")
            print (f"|已累计游玩{time_hour}小时{time_minute}分钟(现实)")
            print (f"|已达成{len (acc_num)}/8个成就")
            print (f"|剧情达成度{story_num / 50 * 100 : .2f}%")
            print ("|---------------------------------------")
            print ("|1. 顾客图鉴")
            print ("|2. 成就")
            print ("|0. 返回")
            print ("|---------------------------------------")
            chos = int (input ("输入需要的功能："))
            if (chos == 1):
                Customer.Illustrated ()
            elif (chos == 2):
                Accomplishment.AllAccomplishment (acc_num)
            elif (chos == 0):
                os.system ('cls')
                return time_hour, time_minute, time_second
            else :
                raise ValueError
        except ValueError:
            os.system ('cls')
            print ("\033[1;31m无效选项！\033[0m\n")